# -*- coding: utf-8 -*-
from django.db import models


#
# Slownik: plec
class Gender (models.Model):
	name = models.CharField (max_length = 10);

	def __unicode__(self):
		return u"%s" % self.name;

#
# Slownik: stan cywilny
class MaritalStatus (models.Model):
	name = models.CharField (max_length = 15);

	def __unicode__(self):
		return u"%s" % self.name;

#
# Profil pacjenta
class Profile (models.Model):
	first_name = models.CharField (max_length = 23, verbose_name=u"Imię");
	last_name = models.CharField (max_length = 23, verbose_name=u"Nazwisko");
	street = models.CharField (max_length = 31, null=True, blank=True, verbose_name=u"Ulica");
	postal_code = models.CharField (max_length = 7, null=True, blank=True, verbose_name=u"Kod pocztowy");
	city = models.CharField (max_length = 31, null=True, blank=True, verbose_name=u"Miejscowość");
	phone = models.CharField (max_length = 15, null=True, blank=True, verbose_name=u"Telefon");
	personal_id = models.CharField (max_length = 15, null=True, blank=True, verbose_name=u"PESEL");
	birthday = models.DateField (null=True, blank=True, verbose_name=u"Data urodzin");
	gender = models.ForeignKey (Gender, null=True, blank=True, verbose_name=u"Płeć");
	marital_status = models.ForeignKey (MaritalStatus, null=True, blank=True, verbose_name=u"Stan cywilny");
	family_status = models.CharField (max_length = 23, null=True, blank=True, verbose_name=u"Stan rodzinny");
	workplace = models.CharField (max_length = 63, null=True, blank=True, verbose_name=u"Miejsce pracy");
	conditions = models.CharField (max_length = 511, null=True, blank=True, verbose_name=u"Szkodliwość warunków pracy");
	medical_history = models.CharField (max_length = 511, null=True, blank=True, verbose_name=u"Przebyte choroby");
	family_illness = models.CharField (max_length = 511, null=True, blank=True, verbose_name=u"Obciążenia rodzinne");
	comment = models.CharField (max_length = 255, null=True, blank=True, verbose_name=u"Uwagi");

	class Meta:
		verbose_name = u"Profil pacjenta";
		ordering = ['-id'];

	def __unicode__(self):
		return u"%s %s %s" % (self.first_name, self.last_name, self.personal_id);

